﻿using RBACProject.Application.Role.Dto;
using RBACProject.Domian;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RBACProject.Application.Role
{
    /// <summary>
    /// 角色服务层接口
    /// </summary>
    public interface IRoleServer
    {
        /// <summary>
        /// 查询全部角色信息
        /// </summary>
        /// <returns></returns>
        ResultDto<List<RoleModel>> GetRoleList();

        /// <summary>
        /// 查询  按主键查
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<RoleModel> RoleQueryById(int id);

        /// <summary>
        /// 用户角色设置
        /// </summary>
        /// <returns></returns>
        Task<ResultDto<UserRoleModel>> AddUserRoleInfo(UserRoleModel model);

        /// <summary>
        /// 新增角色信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResultDto<RoleModel>> AddRoleInfo(RoleModel model);

        /// <summary>
        /// 删除角色信息
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns></returns>
        Task<ResultDto<int>> DeleteRole(int id);

        /// <summary>
        /// 查询角色全部数据
        /// </summary>
        /// <param name="roleId">角色编号</param>
        /// <param name="userName">用户名</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="totalCount">总行数</param>
        /// <param name="totalCount">分页总数</param>
        /// <returns></returns>
        List<UserRoleDto> GetRoleInfo(int roleId, string userName, int pageIndex, int pageSize, out int totalCount, out int pageCount);

        /// <summary>
        /// 修改角色信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResultDto<RoleModel>> UpdRoleInfo(RoleModel model);
    }
}
